﻿using System;
using System.ServiceModel;
using System.ServiceModel.Activation;
using ServiceLibrary;

namespace WASHosting
{
    [ServiceContract(Namespace = "bluemarine")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class AjaxService
    {
        // To use HTTP GET, add [WebGet] attribute. (Default ResponseFormat is WebMessageFormat.Json)
        // To create an operation that returns XML,
        //     add [WebGet(ResponseFormat=WebMessageFormat.Xml)],
        //     and include the following line in the operation body:
        //         WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml";
        [OperationContract]
        public bool CustomerEmailCheck(string email)
        {
            try
            {
                var _ex = new ExternalService();
                return _ex.CustomerEmailCheck(email);
            }
            catch (Exception ex)
            {
                throw new FaultException(ex.Message);
            }
        }

        // Add more operations here and mark them with [OperationContract]
    }
}